import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:qaun_ni_dev/provider/loginProvider.dart';
import 'package:qaun_ni_dev/pages/person/test_slide_page.dart';


class Person extends StatefulWidget {
  @override
  _PersonState createState() => _PersonState();
}

class _PersonState extends State<Person> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('我的'),
      ),
      body: Container(
        padding: EdgeInsets.all(10),
        child: ListView(
          children: <Widget>[
            Container(
              decoration: BoxDecoration(
                border: Border.all(width: 1,color: Colors.grey),
              ),
              child: ListTile(
                leading: Icon(Icons.person),
                onTap: () {
                  Provider.of<LoginProvider>(context,listen: false).deleteUserToken(context);
                },
                title: Text('退出登录'),
              ),
            ),
             Container(
                margin: EdgeInsets.only(top: 10),
                decoration: BoxDecoration(
                  border: Border.all(width: 1,color: Colors.grey),
                ),
                child: ListTile(
                  leading: Icon(Icons.person),
                  onTap: () {
                    Provider.of<LoginProvider>(context,listen: false).changeTheme1();
                  },
                  title: Text('选择粉色主题'),
                ),
              ),
            Container(
              margin: EdgeInsets.only(top: 10),
              decoration: BoxDecoration(
                border: Border.all(width: 1,color: Colors.grey),
              ),
              child: ListTile(
                leading: Icon(Icons.person),
                onTap: () {
                  Provider.of<LoginProvider>(context,listen: false).changeTheme2();
                },
                title: Text('选择蓝色主题'),
              ),
            ),

//            Container(
//              decoration: BoxDecoration(
//                border: Border.all(width: 1,color: Colors.pink),
//              ),
//              child: ListTile(
//                onTap: () {
//                  Navigator.push(context, MaterialPageRoute(
//                    builder: (context) {
//                      return TestSlidePage();
//                    }
//                  ));
//                },
//                title: Text('测试左右滑动'),
//              ),
//            ),
          ],
        ),
      ),
    );
  }
}
